<html>
<head><meta charset="utf-8"><title>Trouble building stdlib · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html">Trouble building stdlib</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="212506378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212506378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> James Gill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212506378">(Oct 07 2020 at 01:36)</a>:</h4>
<p>Hi all.  I'm trying to run tests on the standard library, in preparation for a PR for stabilizing <a href="https://github.com/rust-lang/rust/issues/55300">https://github.com/rust-lang/rust/issues/55300</a>.  I'm following the instructions in the <a href="https://rustc-dev-guide.rust-lang.org/getting-started.html">getting started guide</a>, but it dies trying to find <code>ninja</code>, and my attempts to set <code>ninja = false</code> have failed.  My steps are below.  Any advice would be appreciated!</p>
<ol>
<li>
<p>Cloned rust</p>
</li>
<li>
<p><code>python3 x.py setup</code> -&gt; a) Contribute to standard library<br>
Got error:<br>
Couldn't find required command: ninja<br>
You should install ninja, or set ninja=false in config.toml</p>
</li>
<li>
<p>ninja isn't in brew, it looks like I'd have to manually install a binary that I'd forget about maintaining, so I look for config.toml</p>
</li>
<li>
<p>There is no config.toml, but there's a config.toml.example that says:</p>
</li>
</ol>
<h1>To configure rustbuild, copy this file to the directory from which you will be</h1>
<h1>running the build, and name it config.toml.</h1>
<ol start="5">
<li>
<p>I copy config.toml.example to config.toml, adding a <code>ninja = false</code> line.</p>
</li>
<li>
<p><code>python3 x.py setup</code> -&gt; a) Contribute to standard library <br>
Got error<br>
error: you asked <code>x.py</code> to setup a new config file, but one already exists at <code>config.toml</code><br>
help: try adding <code>profile = "library"</code> at the top of config.toml<br>
note: this will use the configuration in /Users/jagill/dev/rust/src/bootstrap/defaults/config.library.toml</p>
</li>
<li>
<p>I add the line <code>profile = "library"</code> to the top of config.toml.<br>
Same error!<br>
error: you asked <code>x.py</code> to setup a new config file, but one already exists at <code>config.toml</code><br>
help: try adding <code>profile = "library"</code> at the top of config.toml<br>
note: this will use the configuration in /Users/jagill/dev/rust/src/bootstrap/defaults/config.library.toml</p>
</li>
<li>
<p>??? What now?</p>
</li>
</ol>



<a name="212506402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212506402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> James Gill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212506402">(Oct 07 2020 at 01:37)</a>:</h4>
<p>I should say that I'm in macos!  (latest version, more or less)</p>



<a name="212506412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212506412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212506412">(Oct 07 2020 at 01:37)</a>:</h4>
<p><span class="user-mention" data-user-id="350322">@James Gill</span> you don't need to both copy config.toml and run x.py setup</p>



<a name="212506426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212506426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212506426">(Oct 07 2020 at 01:37)</a>:</h4>
<p>hmm that error message is not very helpful :/ it should say "if you have profile = ... you don't need to run x.py setup"</p>



<a name="212506495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212506495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> James Gill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212506495">(Oct 07 2020 at 01:39)</a>:</h4>
<p>I copied config.toml just to set <code>nina = false</code>.  I don't know if I should do anything more intelligent if I copy config.toml, or if there's a way to set <code>ninja = false</code> without config.toml?</p>



<a name="212506511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212506511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> James Gill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212506511">(Oct 07 2020 at 01:39)</a>:</h4>
<p>Should I just <code>cargo test</code> then?</p>



<a name="212506601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212506601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212506601">(Oct 07 2020 at 01:40)</a>:</h4>
<p>all the settings in <code>config.toml.example</code> can be set without it. since you already copied it all you need to do is change <code>ninja = true</code> to <code>ninja = false</code>, then <code>x.py test --stage 0 library/std</code></p>



<a name="212506895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212506895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> James Gill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212506895">(Oct 07 2020 at 01:46)</a>:</h4>
<p>Ok, great, now it's finding real errors.  Follow-up question: if I'm stabilizing a feature, should I replace <code>#[unstable(feature = "foo", issue = "xxx")]</code> with <code>#[stable(feature = "foo", since = "1.XX.0")]</code>?  Is there some canonical choice for the <code>since</code> version?</p>



<a name="212506907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212506907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212506907">(Oct 07 2020 at 01:47)</a>:</h4>
<p><code>since</code> is the version of rust it was stabilized in. in your case it's 1.49.0: <a href="https://forge.rust-lang.org/#current-release-versions">https://forge.rust-lang.org/#current-release-versions</a></p>



<a name="212507337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212507337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> James Gill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212507337">(Oct 07 2020 at 01:54)</a>:</h4>
<p>That worked, and the tests pass!  Thanks!</p>



<a name="212507346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Trouble%20building%20stdlib/near/212507346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Trouble.20building.20stdlib.html#212507346">(Oct 07 2020 at 01:54)</a>:</h4>
<p>you're welcome :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>